import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
import settings from './modules/settings'
import user from './modules/user'
// 导入数据持久
import persistedstate from 'vuex-persistedstate'

Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    app,
    settings,
    user
  },
  // 计算属性不会使用很多，所以有些网站就没有放模块化内
  getters: getters,
  // 配置插件
  plugins: [
    persistedstate({
      paths: ['user.token']
    })
  ]
})

export default store
